package group5.study.boitoan;

import group5.study.resources.Variables;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class ListMainActivity extends ListActivity{

	private TextView txtTitleMain;
	private ArrayAdapter<String> adapter;
	
	
    @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
         
   /* tập tin res/layout/ làm 
        layout hiển thị cho activity này*/
        setContentView(R.layout.list_main);
        
        switch (Variables.title) {
		case 0: Variables.Category1 = getResources().getStringArray(R.array.itemPhongthuyOnline);			
			break;
		case 1: Variables.Category1 = getResources().getStringArray(R.array.itemLoiKhuyenPhongThuy);		
			break;
		case 2: Variables.Category1 = getResources().getStringArray(R.array.itemBoiTheoConGiap);		
		break;
		case 3: Variables.Category1 = getResources().getStringArray(R.array.itemBoiTinhYeu);		
		break;
		case 4: Variables.Category1 = getResources().getStringArray(R.array.itemBoiLinhTinh);		
		break;
		case 5: Variables.Category1 = getResources().getStringArray(R.array.itemBoiHinhDang);		
		break;
		case 6: Variables.Category1 = getResources().getStringArray(R.array.itemBoiHinhDang);		
		break;
		default:
			break;
		}
        
        adapter = new ArrayAdapter<String>(ListMainActivity.this,R.layout.category_item,R.id.content,Variables.Category1);
		setListAdapter(adapter);
        
        txtTitleMain=(TextView)findViewById(R.id.txtTitleMain);
        txtTitleMain.setText(Variables.titleDefaultMenu[Variables.title]);
    }

}
